# Contributor: Fernando Casas Schossow <casasfernando@outlook.com>
# Maintainer: Fernando Casas Schossow <casasfernando@outlook.com>
pkgname=virglrenderer
pkgver=0.8.2
pkgrel=1
pkgdesc="A virtual 3D GPU library, that allows the guest operating system to use the host GPU to accelerate 3D rendering"
url="https://virgil3d.github.io/"
options="!check"
arch="all"
license="MIT"
makedepends="meson file libdrm-dev mesa-dev libepoxy-dev python3 check-dev"
subpackages="$pkgname-dev"
source="https://gitlab.freedesktop.org/virgl/virglrenderer/-/archive/virglrenderer-$pkgver/virglrenderer-virglrenderer-$pkgver.tar.gz
	musl-fixes.patch"
builddir="$srcdir/$pkgname-$pkgname-$pkgver"

# secfixes:
#   0.8.1-r0:
#     - CVE-2019-18388
#     - CVE-2019-18389
#     - CVE-2019-18390
#     - CVE-2019-18391

build() {
	meson \
		--prefix=/usr \
		--buildtype=plain \
		-Dtests=true \
	. output
	ninja -C output
}

package() {
	DESTDIR="$pkgdir" ninja -C output install
}

check() {
	ninja -C output test
}

sha512sums="a64069bf6a28e5b77da53b5226a447decc3fe07a5c28bc49c2c15413b7651605170c5644a24f6a0ce9216a0f55afcee0246c3e4d9bc8f32dad771be3115e0f2a  virglrenderer-virglrenderer-0.8.2.tar.gz
8f12548eb6ea3a2ac4f90ae74dbb338df0f57876104eb27e78d7acc184c0fe3b192636001606197a59b9cb286e8417579e41df3e132999ab0e3472d6604f8a3e  musl-fixes.patch"
